package cn.edu.cqie.maven_onlinexem.serviceImp;

import cn.edu.cqie.maven_onlinexem.bean.question;
import cn.edu.cqie.maven_onlinexem.dao.QuestionDao;
import cn.edu.cqie.maven_onlinexem.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class QuestionServiceImp implements QuestionService {
    @Autowired
    QuestionDao questionDao;

    @Override
    public void insertQuestion(question question) {
        questionDao.insertQuestion(question);
    }

    @Override
    public boolean findQuestion_name(String question_name) {
        List<question> questions = questionDao.findQuestion_name(question_name);
        return questions.size()>0;
    }

    @Override
    public List<question> findQuestionAll(question question) {
        List<question> questions = questionDao.findeQuestionAll(question);
        return questions;
    }

}
